import subprocess
import time
import sys
import re

port = sys.argv[1]
file = sys.argv[2]



assert port is not None
assert file is not None


f = open(file).readlines()
for _, i in enumerate(f):
    try:
        ip = re.findall(r"\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b", i)[0]
        time.sleep(2.5)
        cmd = "sh send.sh {} {} ".format(ip, port)
        subprocess.Popen(cmd, shell=True)
    except:
        pass
print("done")

